package cmm;


/**
 * @Author caomm
 * 全局配置类
 */
public class GlobalOptions {
    /**
     * 是否关闭子类
     */
    public static volatile boolean isDisableSubClass = false;

    /**
     *  Dao层调用监控
     * */
    public static final String SQLDAOCLASS = "com/digiwin/app/dao/DWDao";

    /**
     *  外部调用监控层
     * */
    public static final String HTTPCLIENTCLASS01 = "AppCommonUtils";
    /**
     *  外部调用监控层
     * */
    public static final String HTTPCLIENTCLASS02 = "ServiceClient";

    /**
     *  类方法字符格式
     * */
    public static String getClassMethod(String clasz ,String methodName){
        return clasz + "# " + methodName + " ===> ";
    };

    /**
     *  DAO层监控方法
     * */
    public static boolean isSqlExecute(String name) {
        if ("select".equals(name)
                || "selectOne".equals(name)
                || "update".equals(name)
                || "delete".equals(name)
                || "execute".equals(name)
                || "updateBatch".equals(name)
                || "selectWithPage".equals(name)
                || "updateBatch".equals(name)) {
            return true;
        }
        return false;
    }

    /**
     *  Http外部调用监控方法
     * */
    public static boolean isHttpClient01(String name) {
        if ("invokeSyncAgileApi".equals(name)
                || "invokeSyncStableApi".equals(name)
                || "invokeThisDapService".equals(name)) {
            return true;
        }
        return false;
    }
    /**
     *  Http外部调用监控方法
     * */
    public static boolean isHttpClient02(String name) {
        if ("invokeThisDapService".equals(name)) {
            return true;
        }
        return false;
    }
}
